package com.sulent.frame.support.enums;

public enum ErrorCode {
    SYSTEM_ERROR(1001, "服务器错误"),
    SC_UNAUTHORIZED(4010, "访问令牌不合法"),
    SC_FORBIDDEN(4030, "没有权限访问该资源"),
    SC_FORBIDDEN_UN_GATEWAY(4031, "请通过网关获取资源");

    int code;
    String msg;

    private ErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String getMessage(int code) {
        ErrorCode[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            ErrorCode errorCode = var1[var3];
            if (code == errorCode.code) {
                return errorCode.getMsg();
            }
        }

        return null;
    }

    public int getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }
}
